<template>
  <el-container class="layout-container">
    <el-container class="content-wrapper">
      <Header />
      <div style="display: flex">
        <MenuVertical class="s-aside" />
        <div class="main-container">
          <div class="nav-bar">
            <NavTabs />
          </div>
          <Main />
        </div>
      </div>
    </el-container>
  </el-container>
  <CloseFullScreen v-if="navTabs.state.tabFullScreen" />
</template>

<script setup>
import Header from "../components/header.vue";
import Main from "../router-view/main.vue";
import CloseFullScreen from "../components/closeFullScreen.vue";
import { useNavTabs } from "@/stores/navTabs";
import MenuVertical from "../components/menus/menuVertical.vue";
import { useConfig } from '@/stores/config'
import { computed } from 'vue'
import NavTabs from "../components/navBar/tabs.vue";
const navTabs = useNavTabs();
const config = useConfig()
const menuWidth = computed(() => config.menuWidth())
</script>

<style scoped>
.layout-container {
  height: 100%;
  width: 100%;
}

.content-wrapper {
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.s-aside {
  width: v-bind(menuWidth);
  background: v-bind('config.getColorVal("menuBackground")');
  height: calc(100vh - 56px);
}

.main-container {
  width: calc(100% - v-bind(menuWidth));
}

.nav-bar {
  display: flex;
  height: 40px;
  width: 100%;
  background-color: v-bind('config.getColorVal("headerBarBackground")');
  font-size: 14px;
}

.nav-bar :deep(.nav-tabs) {
  display: flex;
  height: 100%;
  position: relative;
}

.nav-bar :deep(.nav-tabs) .ba-nav-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  cursor: pointer;
  z-index: 1;
  height: 100%;
  user-select: none;
  color: v-bind('config.getColorVal("headerBarTabColor")');
  transition: all 0.2s;
  -webkit-transition: all 0.2s;
}

.nav-bar :deep(.nav-tabs) .ba-nav-tab .close-icon {
  padding: 2px;
  margin: 3px 0 0 4px;
}

.nav-bar :deep(.nav-tabs) .ba-nav-tab .close-icon:hover {
  /*background: var(--ba-color-primary-light);*/
  /*color: var(--el-border-color) !important;*/
  /*border-radius: 50%;*/
}

.nav-bar :deep(.nav-tabs) .ba-nav-tab.active {
  color: v-bind('config.getColorVal("headerBarTabActiveColor")');
  background-color: v-bind('config.getColorVal("headerBarHoverBackground")');
}

.nav-bar :deep(.nav-tabs) .ba-nav-tab:hover {
  color: v-bind('config.getColorVal("headerBarTabActiveColor")');
}

.nav-bar :deep(.nav-tabs) .nav-tabs-active-box {
  position: absolute;
  height: 50px;
  background-color: v-bind('config.getColorVal("headerBarTabActiveBackground")');
  transition: all 0.2s;
  -webkit-transition: all 0.2s;
}</style>
